package com.kbbywyclient.ui.activity;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.kbbywyclient.R;
import com.kbbywyclient.di.AppComponent;
import com.kbbywyclient.ui.activity.base.BaseActivity;
import com.kbbywyclient.util.ViewUtils;
import com.kbbywyclient.widget.CustomToolBar;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Jiangzx on 2017/9/8 15:33.
 * 佣金提现提交成功后页面
 */

public class CommissionWithdrawSubmitActivity extends BaseActivity {
    public static final String CARD_INFO_S="cardInfo";
    public static final String AMOUNT_D="amount";
    @BindView(R.id.v_toolbar)
    CustomToolBar toolBar;
    @BindView(R.id.tv_expected_arrival_time_value)
    TextView tvTime;
    @BindView(R.id.tv_bank_card_value)
    TextView tvBank;
    @BindView(R.id.tv_withdraw_money_value)
    TextView tvMoney;
    
    @Override
    protected int provideContentViewId() {
        return R.layout.activity_commission_withdraw_submit;
    }

    @Override
    protected void initView() {
        toolBar.setLeftViewOnClickLinster(v->finish());
        Calendar calendar=Calendar.getInstance();
        calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
        calendar.setTime(new Date());
        calendar.add(Calendar.DAY_OF_MONTH,2);
        tvTime.setText(new SimpleDateFormat("yyyy.MM.dd", Locale.CHINESE).format(calendar.getTime()));

        Intent intent=getIntent();
        ViewUtils.setText(tvBank,intent.getStringExtra(CARD_INFO_S));

        tvMoney.setText("￥"+intent.getDoubleExtra(AMOUNT_D,0.00D));

    }

    @Override
    public void initData() {

    }

    @Override
    protected void onResume() {
        super.onResume();
        setScreenName("佣金提现-申请提交");
    }

    @Override
    public void initAppComponent(AppComponent appComponent) {

    }
    
    @OnClick(R.id.bt_complete)
    public void onClick(View view){
        switch (view.getId()){
            case R.id.bt_complete:
                finish();
                break;
        }
    }
}
